package com.leilei.join.window;

import com.leilei.join.common.VehicleInfo;
import org.apache.flink.api.common.functions.JoinFunction;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.api.java.tuple.Tuple4;

/**
 * @author lei
 * @version 1.0
 * @date 2021/3/27 16:52
 * @desc 车辆与类型join
 */
public class AggregationVehicleJoinFunction implements JoinFunction<VehicleInfo, Tuple2<Integer, String>,
        Tuple4<Integer, String, Integer, String>> {

    @Override
    public Tuple4<Integer, String, Integer, String> join(VehicleInfo first, Tuple2<Integer, String> second) throws Exception {
        return Tuple4.of(first.getVehicleId(), second.f1, first.getCreateTime(), first.getColor());
    }
}